
package formularios;

import com.toedter.calendar.JDateChooser;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import javax.swing.JOptionPane;

/**
 *
 * @author Rulber
 */
public class nuevo extends javax.swing.JInternalFrame {
    
    private void mostrarDetalle()
    {
        String sql="select descripcion from temas where nombre = '"+comboTema.getSelectedItem().toString()+"'";
        try{
            ResultSet rs = conexionBD.s.executeQuery (sql);
            while (rs.next()) {
                txtDetalleT.setText(rs.getString(1));
            }
        }
        catch(SQLException err){
            JOptionPane.showMessageDialog(null,"Error al recuperar Descripción","SADEC",JOptionPane.INFORMATION_MESSAGE);
        }
        detalleTema.setLocationRelativeTo(null);
        detalleTema.setSize(507, 312);
        detalleTema.setTitle("Auditoría de "+comboTema.getSelectedItem().toString());                
        detalleTema.setVisible(true);
    }
    
    private void cambiarAuditor()
    {
        String mensaje;
        Object [] opciones ={"SI","NO"}; int eleccion;
        mensaje="Confirma que desea Cambiar de Auditor? \nEsta Acción Cerrara la ventana de Trabajo Actual \n"
                +"y le pedira que se loguee nuevamente";
                eleccion = JOptionPane.showOptionDialog(null,mensaje,
                "Cambiar Auditor",
                JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,
                null, opciones,"SI");
        if (eleccion == JOptionPane.YES_OPTION)
        {
            principal.archivo_cambiaUss.doClick();
        }
    }
    
    private String recuperarFecha(JDateChooser Fecha)
    {
        String dato;
        try{
            dato = new SimpleDateFormat("dd/MM/yyyy").format(Fecha.getDate());
            return dato;
        }
        catch(NullPointerException err)
        {
            return "";
        }
    }
    
    private void siguiente()
    {
        String fechaInicio=recuperarFecha(txtFechaInicio);
        String fechaFin=recuperarFecha(txtFechaFin);
        
        if(txtRucAuditado.getText().equals("") || fechaInicio.equals("") || fechaFin.equals(""))
        {
            JOptionPane.showMessageDialog(null,"Debe Llenar Todos los Campos Obligatorios","SADEC",JOptionPane.ERROR_MESSAGE);
        }
        else
        {
            if(txtFechaInicio.getDate().compareTo(txtFechaFin.getDate())>0)
            {
                JOptionPane.showMessageDialog(null,"La Fecha Final No puede ser Antes que la Fecha Inicio","SADEC",JOptionPane.ERROR_MESSAGE);
            }
            else
            {
                
            }
        }
    }
    
    public nuevo(String nombre,String ruc,String direcc) {
        initComponents();
        txtNombreAuditado.setText(nombre);
        txtRucAuditado.setText(ruc);
        txtDireccionAuditado.setText(direcc);
        txtNombreAuditor.setText(principal.nombresUsuario+" "+principal.apellidosUsuario);
        txtDniAuditor.setText(principal.dniUsuario);
        txtProfesionAuditor.setText(principal.profesionUsuario);
        txtColegiaturaAuditor.setText(principal.colegiaturaUsuario);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panelAuditado = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        txtNombreAuditado = new javax.swing.JTextField();
        btnAuditado = new javax.swing.JButton();
        txtRucAuditado = new javax.swing.JTextField();
        txtDireccionAuditado = new javax.swing.JTextField();
        panelAuditor = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        txtNombreAuditor = new javax.swing.JTextField();
        btnCambiarAuditor = new javax.swing.JButton();
        txtDniAuditor = new javax.swing.JTextField();
        txtProfesionAuditor = new javax.swing.JTextField();
        txtColegiaturaAuditor = new javax.swing.JTextField();
        detalleTema = new javax.swing.JDialog();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtDetalleT = new javax.swing.JTextArea();
        btnAceptarDT = new javax.swing.JButton();
        tabPanel = new javax.swing.JTabbedPane();
        panelAuditoria = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        comboTema = new javax.swing.JComboBox();
        btnDetalleDesc = new javax.swing.JButton();
        txtFechaInicio = new com.toedter.calendar.JDateChooser();
        txtFechaFin = new com.toedter.calendar.JDateChooser();
        btnCancelar = new javax.swing.JButton();
        btnSiguiente = new javax.swing.JButton();

        jLabel1.setText("Nombre:");

        jLabel2.setText("RUC:");

        jLabel3.setText("Dirección:");

        txtNombreAuditado.setEditable(false);

        btnAuditado.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/auditado-icon.png"))); // NOI18N
        btnAuditado.setText(".");
        btnAuditado.setToolTipText("Seleccionar Auditado");
        btnAuditado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAuditadoActionPerformed(evt);
            }
        });
        btnAuditado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnAuditadoKeyPressed(evt);
            }
        });

        txtRucAuditado.setEditable(false);

        txtDireccionAuditado.setEditable(false);

        javax.swing.GroupLayout panelAuditadoLayout = new javax.swing.GroupLayout(panelAuditado);
        panelAuditado.setLayout(panelAuditadoLayout);
        panelAuditadoLayout.setHorizontalGroup(
            panelAuditadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAuditadoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelAuditadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(panelAuditadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelAuditadoLayout.createSequentialGroup()
                        .addComponent(txtRucAuditado, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 215, Short.MAX_VALUE))
                    .addGroup(panelAuditadoLayout.createSequentialGroup()
                        .addGroup(panelAuditadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(txtDireccionAuditado)
                            .addComponent(txtNombreAuditado))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnAuditado, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        panelAuditadoLayout.setVerticalGroup(
            panelAuditadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAuditadoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelAuditadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txtNombreAuditado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAuditado))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAuditadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txtRucAuditado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAuditadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(txtDireccionAuditado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel6.setText("Nombre y Apellidos:");

        jLabel8.setText("DNI:");

        jLabel9.setText("Profesión:");

        jLabel10.setText("Colegiatura:");

        txtNombreAuditor.setEditable(false);

        btnCambiarAuditor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cambiarUss-icon.png"))); // NOI18N
        btnCambiarAuditor.setToolTipText("Cambiar Auditor");
        btnCambiarAuditor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCambiarAuditorActionPerformed(evt);
            }
        });
        btnCambiarAuditor.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnCambiarAuditorKeyPressed(evt);
            }
        });

        txtDniAuditor.setEditable(false);

        txtProfesionAuditor.setEditable(false);

        txtColegiaturaAuditor.setEditable(false);

        javax.swing.GroupLayout panelAuditorLayout = new javax.swing.GroupLayout(panelAuditor);
        panelAuditor.setLayout(panelAuditorLayout);
        panelAuditorLayout.setHorizontalGroup(
            panelAuditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAuditorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelAuditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE)
                    .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAuditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelAuditorLayout.createSequentialGroup()
                        .addGroup(panelAuditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelAuditorLayout.createSequentialGroup()
                                .addComponent(txtDniAuditor, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 108, Short.MAX_VALUE))
                            .addComponent(txtNombreAuditor))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnCambiarAuditor, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelAuditorLayout.createSequentialGroup()
                        .addGroup(panelAuditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtProfesionAuditor, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtColegiaturaAuditor, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        panelAuditorLayout.setVerticalGroup(
            panelAuditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAuditorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelAuditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(txtNombreAuditor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnCambiarAuditor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAuditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(txtDniAuditor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAuditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(txtProfesionAuditor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAuditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(txtColegiaturaAuditor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        detalleTema.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        detalleTema.setModal(true);
        detalleTema.setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        txtDetalleT.setColumns(20);
        txtDetalleT.setEditable(false);
        txtDetalleT.setRows(5);
        jScrollPane1.setViewportView(txtDetalleT);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 483, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
        );

        btnAceptarDT.setText("Aceptar");
        btnAceptarDT.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarDTActionPerformed(evt);
            }
        });
        btnAceptarDT.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnAceptarDTKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout detalleTemaLayout = new javax.swing.GroupLayout(detalleTema.getContentPane());
        detalleTema.getContentPane().setLayout(detalleTemaLayout);
        detalleTemaLayout.setHorizontalGroup(
            detalleTemaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(detalleTemaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(detalleTemaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(detalleTemaLayout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, detalleTemaLayout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(btnAceptarDT)))
                .addContainerGap())
        );
        detalleTemaLayout.setVerticalGroup(
            detalleTemaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(detalleTemaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnAceptarDT)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        setClosable(true);
        setTitle("NUEVA AUDITORIA");
        setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/icono.png"))); // NOI18N

        tabPanel.add("Auditado", panelAuditado);
        tabPanel.add("Auditor", panelAuditor);
        tabPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N

        panelAuditoria.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos Auditoría", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N

        jLabel7.setText("Tema:");

        jLabel4.setText("Fecha Inicio:");

        jLabel5.setText("Fecha Fin:");

        comboTema.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Base de Datos", "Equipos de Computo" }));

        btnDetalleDesc.setText("...");
        btnDetalleDesc.setToolTipText("Descripción");
        btnDetalleDesc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDetalleDescActionPerformed(evt);
            }
        });
        btnDetalleDesc.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnDetalleDescKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout panelAuditoriaLayout = new javax.swing.GroupLayout(panelAuditoria);
        panelAuditoria.setLayout(panelAuditoriaLayout);
        panelAuditoriaLayout.setHorizontalGroup(
            panelAuditoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAuditoriaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelAuditoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE)
                    .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAuditoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelAuditoriaLayout.createSequentialGroup()
                        .addComponent(comboTema, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnDetalleDesc, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelAuditoriaLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(panelAuditoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtFechaFin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(83, Short.MAX_VALUE))
        );
        panelAuditoriaLayout.setVerticalGroup(
            panelAuditoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAuditoriaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelAuditoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(comboTema, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnDetalleDesc))
                .addGap(8, 8, 8)
                .addGroup(panelAuditoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(txtFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAuditoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel5)
                    .addComponent(txtFechaFin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        btnCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cancelar.png"))); // NOI18N
        btnCancelar.setToolTipText("Cancelar");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });
        btnCancelar.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnCancelarKeyPressed(evt);
            }
        });

        btnSiguiente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/sig.png"))); // NOI18N
        btnSiguiente.setToolTipText("Siguiente");
        btnSiguiente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSiguienteActionPerformed(evt);
            }
        });
        btnSiguiente.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnSiguienteKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(tabPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 421, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(panelAuditoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(89, 89, 89)
                        .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnSiguiente, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(96, 96, 96))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(tabPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelAuditoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnCancelar)
                    .addComponent(btnSiguiente))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnAuditadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAuditadoActionPerformed
        principal.mostrarSelecAuditado();
        this.dispose();
    }//GEN-LAST:event_btnAuditadoActionPerformed

    private void btnCambiarAuditorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCambiarAuditorActionPerformed
        cambiarAuditor();
    }//GEN-LAST:event_btnCambiarAuditorActionPerformed

    private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
        principal.nuevaAuditoria=true;
        this.dispose();
    }//GEN-LAST:event_btnCancelarActionPerformed

    private void btnDetalleDescActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDetalleDescActionPerformed
        mostrarDetalle();
    }//GEN-LAST:event_btnDetalleDescActionPerformed

    private void btnAceptarDTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarDTActionPerformed
        detalleTema.dispose();
    }//GEN-LAST:event_btnAceptarDTActionPerformed

    private void btnDetalleDescKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnDetalleDescKeyPressed
        if(evt.getKeyCode() == 10)
            mostrarDetalle();
    }//GEN-LAST:event_btnDetalleDescKeyPressed

    private void btnAceptarDTKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnAceptarDTKeyPressed
        if(evt.getKeyCode() == 10)
            detalleTema.dispose();
    }//GEN-LAST:event_btnAceptarDTKeyPressed

    private void btnCambiarAuditorKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnCambiarAuditorKeyPressed
        if(evt.getKeyCode() == 10)
            cambiarAuditor();
    }//GEN-LAST:event_btnCambiarAuditorKeyPressed

    private void btnAuditadoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnAuditadoKeyPressed
        if(evt.getKeyCode() == 10)
        {
            principal.mostrarSelecAuditado();
            this.dispose();
        }
    }//GEN-LAST:event_btnAuditadoKeyPressed

    private void btnCancelarKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnCancelarKeyPressed
        if(evt.getKeyCode() == 10)
        {
            principal.nuevaAuditoria=true;
            this.dispose();
        }
    }//GEN-LAST:event_btnCancelarKeyPressed

    private void btnSiguienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSiguienteActionPerformed
        siguiente();
    }//GEN-LAST:event_btnSiguienteActionPerformed

    private void btnSiguienteKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnSiguienteKeyPressed
        if(evt.getKeyCode() == 10)
        {
            siguiente();
        }
    }//GEN-LAST:event_btnSiguienteKeyPressed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAceptarDT;
    private javax.swing.JButton btnAuditado;
    private javax.swing.JButton btnCambiarAuditor;
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnDetalleDesc;
    private javax.swing.JButton btnSiguiente;
    private javax.swing.JComboBox comboTema;
    private javax.swing.JDialog detalleTema;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPanel panelAuditado;
    private javax.swing.JPanel panelAuditor;
    private javax.swing.JPanel panelAuditoria;
    private javax.swing.JTabbedPane tabPanel;
    private javax.swing.JTextField txtColegiaturaAuditor;
    private javax.swing.JTextArea txtDetalleT;
    private javax.swing.JTextField txtDireccionAuditado;
    private javax.swing.JTextField txtDniAuditor;
    private com.toedter.calendar.JDateChooser txtFechaFin;
    private com.toedter.calendar.JDateChooser txtFechaInicio;
    private javax.swing.JTextField txtNombreAuditado;
    private javax.swing.JTextField txtNombreAuditor;
    private javax.swing.JTextField txtProfesionAuditor;
    private javax.swing.JTextField txtRucAuditado;
    // End of variables declaration//GEN-END:variables
}
